package com.csu.backmanagesys.Service;

import com.csu.backmanagesys.Domain.Item;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;
@Repository
public interface ItemService {
    public List<Item> selectItem();
    public List<Item> selectItemById(String itemId);

    public List<Item> fuzzySelectItem(String param);

    public  void insertItem(
            String itemId,
            String productId,
            BigDecimal listPrice,
            BigDecimal unitCost,
            int supplierId,
            String status,
            String attribute1,
            String attribute2,
            String attribute3,
            String attribute4,
            String attribute5
    );

    public void insertInventory(
            String itemId,
            int qty
    );

    public  void deleteItem(
            String itemId
    );

    void updateItem(
            String itemId,
            String productId,
            BigDecimal listPrice,
            BigDecimal unitCost,
            int supplierId,
            String status,
            String attribute1,
            String attribute2,
            String attribute3,
            String attribute4,
            String attribute5
    );

    @Transactional
    public void updateItemQty(
      @Param("itemId") String itemId,
      @Param("stockCount") int stockCount
    );


}
